import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout/Index.vue'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  
  {
    path: '/',
    component: Layout,
    redirect:'/home',
    children:[
      {
        path: 'home',
        name: 'Home',
				redirect:'/index',
        component: () => import('@/views/HomeView.vue'),
        meta:{title:'安踏,安踏官方网站'}
      },
      {
        path: 'index',
        name: 'index',
        component: () => import('../views/index.vue'),
      },
			{
			  path: 'flag',
			  name: 'flag',
			  component: () => import('../views/Flag.vue'),
			},
      {
        path: 'login',
        name: 'Login',
        component: () => import('@/views/Login.vue'),
        meta:{title:'登录',hasCustomer:true}
      },
      {
        path: 'register',
        name: 'Register',
        component: () => import('@/views/Register.vue'),
        meta:{title:'注册',hasCustomer:true}
      },
      {
        path: 'shoppingCart',
        name: 'ShoppingCart',
        component: () => import('@/views/ShoppingCart.vue'),
        meta:{title:'购物车'}
      },
      {
        path: 'productlist',
        name: 'productlist',
        component: () => import('../views/ProductList.vue'),
        children:[
         { path: 'man',
          component: () => import('../components/productlist/Man.vue')
        },
        { path: 'woman',
          component: () => import('../components/productlist/Woman.vue')
        },
        { path: 'kids',
          component: () => import('../components/productlist/Kids.vue')
        }
        ]
      },
      {
        path:'antakids',
        name:'AntaKids',
        redirect:'/antakids/introduction',
        component: () => import('../views/AntaKids.vue'),
        meta:{title:'【安踏官方商城】-永不止步Keep Moving'},
        children:[{
          path:'introduction',
          name:'Introduction',
          component:()=>import('../components/Introduction.vue')
        },{
          path:'spokesperson',
          name:'Spokesperson',
          component:()=>import('../components/Spokesperson.vue')
        },{
          path:'equipment',
          name:'Equipment',
          component:()=>import('../components/Equipment.vue')
        },{
          path:'technology',
          name:'Technology',
          component:()=>import('../components/Technology.vue')
        },{
          path:'starproduct',
          name:'Starproduct',
          component:()=>import('../components/Starproduct.vue')
        },{
          path:'cooperation',
          name:'Cooperation',
          component:()=>import('../components/Cooperation.vue')
        },{
          path:'terminal',
          name:'Terminal',
          component:()=>import('../components/Terminal.vue')
        },{
          path:'meeting',
          name:'Meeting',
          component:()=>import('../components/Meeting.vue')
        },]},


      {
        path: 'culture',
        name: 'culture',
        redirect:'/culture/story',
        component: () => import('../views/Culture.vue'),
        children:[
         {
           path: 'story',
           component: () => import('../components/Story.vue'),
         },
         {
          path: 'culture',
          component: () => import('../components/Culture.vue'),
        },
        {
          path: 'history',
          component: () => import('../components/History.vue'),
        },
        {
          path: 'logo',
          component: () => import('../components/Logo.vue'),
        },
        {
          path: 'signed',
          component: () => import('../components/Signed.vue'),
        },
        {
          path: 'responsibility',
          component: () => import('../components/Responsibility.vue'),
        },
        {
          path: 'sendword',
          component: () => import('../components/Sendword.vue'),
        },
        ]
      },
      {
        path:'commoditydetail',
        name:'commoditydetails',
        meta:{title:'【安踏官方商城】-永不止步Keep Moving'},
        component:() => import('../views/commodityDetails.vue')
      },
      {
        path:'contact',
        name:'contact',
        meta:{title:'【安踏官方商城】-永不止步Keep Moving'},
        component:() => import('../components/Contact.vue')
      },
			{
			path:'shipin',
			name:'shipin',
			meta:{title:'观赏视频'},
			component:() => import('../views/shipin.vue')	
			}
    ]
  },
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
